import request from '@/libs/axios.js'
import requests from '@/axios/index.js'

//安排任务
export function addTaskInfo(data) {
  return request({
    url: `/api/admin/taskinfo/addTaskInfo`,
    method: "post",
    data
  });
}

//修改任务
export function editTaskInfo(data) {
  return request({
    url: `/api/admin/taskinfo/editTaskInfo`,
    method: "put",
    data
  });
}

//获取我的任务表格数据
export function getPageList(data) {
  return request({
    url: `/api/admin/taskinfo/pageList`,
    method: "post",
    data
  });
}

//获取参与人数据
export function getParticipateUserList() {
  return request({
    url: `/api/admin/taskinfo/getParticipateUserList`,
    method: "get",
  });
}

//获取所有项目数据
export function getProjectList() {
  return request({
    url: `/api/admin/taskinfo/getProjectList`,
    method: "get",
  });
}

//获取负责人数据
export function getBearUserList() {
  return request({
    url: `/api/admin/taskinfo/getBearUserList`,
    method: "get",
  });
}

//查看任务详情
export function getTaskDetail(taskId) {
  return request({
    url: `/api/admin/taskinfo/detail/${taskId}`,
    method: "get",
  });
}

//完成详情
export function getTaskCompleteStatus(id) {
  return request({
    url: `/api/admin/taskinfo/getTaskCompleteStatus/${id}`,
    method: "get",
  });
}

//关注与取关  
//启动状态 0、启动  1、暂停     
//是否删除 0、未删除  1、已删除
export function stopOrDeleteTaskInfo(data) {
  return request({
    url: `/api/admin/taskinfo/stopOrDeleteTaskInfo`,
    method: "put",
    data
  });
}

//发布任务评论
export function addTaskRecord(data) {
  return request({
    url: `/api/admin/taskrecord/addTaskRecord`,
    method: "post",
    data
  });
}
//发布任务删除评论
export function delTaskRecord(taskRecordId) {
  return request({
    url: `/api/admin/taskrecord/delete/${taskRecordId}`,
    method: "delete"
  });
}

//获取下属任务列表
export function subordinateTask(data) {
  return request({
    url: `/api/admin/taskinfo/subordinateTask`,
    method: "post",
    data
  });
}
//已完成项目
export function completeTaskInfo(data) {
  return requests({
    url: `/api/admin/taskinfo/completeTaskInfo`,
    method: "put",
    data
  });
}



